<? include('functions.php');
function clear($dir)
{
 $lines = scandir($dir);
 foreach ($lines as $line_num => $line) {
if ($line != ".") {
 if ($line != "..") {
$file = "$dir$line";
  if (!(is_dir($file))) {
    unlink($file);
} else { 
$f = $file.'/';
delDir("$f");
}//  if ($type != "") - else -
} // if ($line != "..")
} // if ($line != ".")
 } // foreach
  } // function
$hobla = "";
if (is_writable($_SESSION["trashfile"])) {
   if (!$handle = fopen($_SESSION["trashfile"], 'w+')) {
         die("Cannot open file ($filename)");
         exit;
   }
   if (fwrite($handle, $hobla) === FALSE) {
       die("Cannot write to a needed file ($filename)");
       exit;
   }  
   fclose($handle);
} else {
   die("a needed file is not writable ($_SESSION[trashfile])");
}
?>
<html>
<head>
<title>oPanel V<? echo $ver; ?></title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet"href="style.css">
<script type="text/javascript">
<!--
     window.location = "trash.php";
//-->
</script>
</head>
<body>
<?
clear($_SESSION["trashdir"]);
?>
</body>
</html>
